<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title><s:text name="title" />
		</title>
	</head>
	<body>
		<s:actionerror />
		<s:fielderror></s:fielderror>
		<p>
			<a href="./main.action"><s:text name="return" /> </a>
			<a href="../login/logOut.action"><s:text name="logOut" /> </a>
		</p>
		<s:if test="#session.user.type==2">
			<s:if test="userTicketList.size()>0">
				<b><s:text name="userTicketInfo" /> </b>
				<table cellspacing="1" cellpadding="1" border="1">
					<thead>
						<tr>
							<th>
								<s:text name="realName" />
							</th>
							<th>
								<s:text name="idCard" />
							</th>
							<th>
								<s:text name="flight.name" />
							</th>
							<th>
								<s:text name="flight.price" />
							</th>
							<th>
								<s:text name="userTicket.num" />
							</th>
							<th>
								<s:text name="userTicket.totalPrice" />
							</th>
							<th>
								<s:text name="update"></s:text>
							</th>
							<th>
								<s:text name="delete"></s:text>
							</th>
						</tr>
						<s:iterator value="userTicketList" status="userTicket">
							<s:form action="updateUserTicket" namespace="/mainService">
								<input name="id" type="hidden" value="<s:property value='id'/>">
								<input name="flightId" type="hidden" value="<s:property value='flightId'/>">
								<tr>
									<td>
										<s:property value="realName" />
									</td>
									<td>
										<s:property value="idCard" />
									</td>
									<td>
										<s:property value="flightName" />
									</td>
									<td>
										<s:textfield name="price" />
									</td>
									<td>
										<s:textfield name="num" />
									</td>
									<td>
										<s:textfield name="totalPrice" />
									</td>
									<td>
										<s:submit key="update" />
									</td>
									<td>
										<input type="button" value="<s:text name='delete'/>"
										 onclick="this.form.action='./deleteUserTicket.action';this.form.submit();">
									</td>
								</tr>
							</s:form>
						</s:iterator>
					</thead>
				</table>
			</s:if>
			<s:else>
				<s:text name="noUserTicketList"></s:text>
			</s:else>
		</s:if>
	</body>
</html>
